<template>
  <div class="structure">
    <a-table
      rowKey="id"
      :columns="tableOption"
      :dataSource="loadData"
      :pagination="false"
      :loading="loading"
      :scroll="{ x: 1720 }"
    >
      <template slot-scope="text, record, index" slot="indexLabel">
        <span>{{ index + (page.current - 1) * page.size + 1 }}</span>
      </template>
      <span slot="action" slot-scope="test, record">
        <template>
          <a-button type="link" @click="trend(record)">趋势图</a-button>
        </template>
      </span>
    </a-table>
    <template>
      <div style="width: 100%; position: relative; height: 100px">
        <a-pagination
          show-quick-jumper
          show-size-changer
          v-model="page.current"
          :page-size-options="['10', '20', '30', '40', '50']"
          :total="page.total"
          :page-size.sync="page.size"
          @showSizeChange="onShowSizeChange"
          @change="onShowSizeChange"
          :show-total="(total) => `共 ${total} 条`"
          style="margin: 2% 0; position: absolute; right: 1%"
        />
      </div>
    </template>
    <a-modal title="趋势图" v-model="dialogVisible" width="65%">
      <TrendChart :dataList="dataList" :dataX="dataX" :dataValue="dataValue" v-if="trendShow" />
    </a-modal>
  </div>
</template>

<script src='./salesDetails.js'></script>

<style lang="less">
.salesDetails {
  margin: 10px 0px;
}
</style>